package com.zk.atm.service.impl;

import com.bpms.common.CommonUtil;
import com.bpms.common.JdbcWorker;
import com.bpms.common.VO;
import com.bpms.common.VOList;
import com.bpms.eai.PackTool;
import com.bpms.esb.IService;
import com.bpms.esb.SV;
import com.zk.atm.service.IAtmpDeviceType;

public class AtmpDeviceTypeImpl extends PackTool implements IService,IAtmpDeviceType {
	
	@Override
	public VO exec(VO arg0) {
		byte [] body = (byte[])arg0.getObj("body");
		try{	
			VO t =new VO();
			String m = this.getField(body, body.length, "m");
//			if(m.equals("saveDeviceType")){
				t.voType="ATM.savaDeviceType";
				String TYPE_ID = this.getField(body, body.length, "TYPE_ID");//机器编号
				String TYPE_CODE =this.getField(body, body.length, "TYPE_CODE");//机器
				String TYPE_NAME = this.getField(body, body.length, "TYPE_NAME");//机器名称
				String TIME_MARK = this.getField(body, body.length, "TIME_MARK");//时间
				t.setAttr("TYPE_ID", TYPE_ID);
				t.setAttr("TYPE_CODE", TYPE_CODE);
				t.setAttr("TYPE_NAME", TYPE_NAME);
				t.setAttr("TIME_MARK", TIME_MARK);
//			}
//			else if(m.equals("deleteDeviceType")){
//				t.voType="ATM.deleteDeviceType";
//				String TYPE_ID = this.getField(body, body.length, "TYPE_ID");//机器编号
//				t.setAttr("TYPE_ID", TYPE_ID);
//			}
//			else{
//				
//				t.voType="ATM.queryDeviceTypeList";
				//获取参数v
//				String org_code
//				String ip=
//					t.setAttr(name, value);
//			    SV.g(m, t);
				
			    //查询的service:queryDeviceTypeList
			    JdbcWorker db=null;
			    String condition_sql="select *xxtype t where 1=1 ";
//			    if(org_name!=null&&!ip.equals("")){
//			    	condition_sql+="and  t.org like '%"++"%'";
//			    }
//			    if(ip){
//			    	condition_sql+=" and t.ip ="+ip;
//			    }
//			    VOList result= db.readAll(new VO(), condition_sql);
//			}
			
			CommonUtil.debug("0000");
			return t;
		}catch (Exception e) {
			CommonUtil.debug("9999");
			return null;
		}
	}

}
